#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.61)
AC_INIT([colorido], [0.01], [lucas@dimension.com.br])
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME,AC_PACKAGE_VERSION)
AC_CONFIG_SRCDIR([src])
AC_CONFIG_HEADER([config.h])

# Checks for programs.
AC_PROG_CC
AC_PROG_LIBTOOL


AC_ARG_ENABLE(debug,
			  [  --enable-debug    Turn on debugging],
			  [case "${enableval}" in
			   yes) debug=true ;;
			   no)  debug=false ;;
			   *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
		   esac],[debug=false])
				 AM_CONDITIONAL(DEBUG, test x$debug = xtrue)





# Checks for libraries.
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.8 gobject-2.0)
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)

AC_CHECK_LIB([dl],[dlopen])
AC_CHECK_LIB([pthread],[pthread_create])
AC_CHECK_LIB([event],[event_init])


# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h strings.h sys/socket.h sys/time.h unistd.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_TYPE_UINT32_T

# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([gettimeofday memset socket strchr strdup])

AC_OUTPUT([Makefile src/Makefile])
